<template>
    <div style="width: 100%;height: 100%;background-size: cover;">
        <img id="tp-poster" src="images/tp/poster.png" style="position: absolute;left: 22px;top: 27px;width:840px;height: 472px;" alt="" >

        <div style="position:absolute;left:863px;top: 80px;width: 250px;text-align: center;color: #48536A;font-size: 24px;">
            {{data.title}}
        </div>
        <% if(data.data.length == 0){ %>
        <div style="position: absolute;left: 400px;top: 250px;color: #000000;">暂无数据</div>
        <%}else{%>

        <% for(var i = 0;i< data.data.length;i++){ %>
        <% var item = data.data[i]; %>

        <div name="{{data.name}}"  style="background:#5E7E9E;color: #ffffff;text-align:center;position: absolute;overflow:hidden;font-size: 24px;left: {{item.left}}px;top: {{item.top}}px;width:{{item.width}}px;height:{{item.height}}px;">
            <div style="position:absolute;width: 100%;height: 100%;line-height:{{item.height}}px;left:0px;top: 0px;">{{item.title}} {{"票数："+item.votes}}</div>
            <!--<div style="position:absolute;width: 187px;height: 100%;line-height:{{item.height}}px;right:0px;top: 0px;font-size: 20px;">{{item.publishdate}}</div>-->
        </div>
        <%}%>
        <%}%>
    </div>
</template>
<script>


    (function (){
        return {
            left:0,
            top:0,
            width:230,
            height:400,
            name:"tpList",
            tpl:"tpListTpl",
            listItem:{
                "row":4,
                "col":1,
                "width":230,
                "height":52,
                "space_left":0,
                "space_top":15,
                "padding_left":873,
                "padding_top":180
            },
            data:[
                {"title":"候选人一"},
                {"title":"候选人二"},
                {"title":"候选人三"},
                {"title":"候选人四"},
            ],
            create:function(){
                this.fetchListData(1);
            },
            itemFocusOn:function (item) {
                $("tp-poster").src = requestConfig.serverUrl+item.cover;
                item.dom.style.background = "#FFFFFF";
                item.dom.style.color = "#333F4B";
            },
            itemFocusOut:function (item) {
                item.dom.style.background = "#5E7E9E";
                item.dom.style.color = "#ffffff";
            },
            fetchListData:function(){

            },
            enter:function (item) {

            }
        }
    })()
</script>